<breadcrumbs></breadcrumbs>

<div class="content-container">

    <div ng-show="didAttemptToSaveWithEmptyWorkingUserRating" class="form-alert-container">
        <message key="addEditUserRating.empty"></message>
    </div>

    <form name="addEditUserRatingForm" novalidate="novalidate">

        <label><message key="gen.pkg.title"></message></label>
        <div class="form-control-group">
            <div class="form-control-group-static">
                <pkg-version-label pkg-version="workingUserRating.pkgVersion"></pkg-version-label>
            </div>
        </div>

        <label><message key="addEditUserRating.user.title"></message></label>
        <div class="form-control-group">
            <div class="form-control-group-static">
                <user-label user="workingUserRating.user"></user-label>
            </div>
        </div>

        <label><message key="addEditUserRating.naturalLanguage.title"></message></label>
        <div class="form-control-group">
            <div class="form-control-group-static">
                <natural-language-chooser
                        natural-language-code="workingUserRating.naturalLanguageCode">
                </natural-language-chooser>
            </div>
        </div>

        <label for="comment"><message key="addEditUserRating.comment.title"></message></label>
        <div class="form-control-group" ng-class="deriveFormControlsContainerClasses('comment')">
            <textarea
                    id="comment"
                    name="comment"
                ng-model="workingUserRating.comment"
                autocomplete="off"
                ng-maxlength="4096"
                rows="5"></textarea>
            <error-messages key-prefix="addEditUserRating.comment" error="addEditUserRatingForm.comment.$error"></error-messages>
        </div>

        <label for="stability"><message key="addEditUserRating.stability.title"></message></label>
        <div class="form-control-group">
            <select
                    id="stability"
                    ng-model="workingUserRating.userRatingStabilityOption"
                    ng-options="aUserRatingStabilityOption.title for aUserRatingStabilityOption in userRatingStabilityOptions">
            </select>
        </div>

        <label><message key="addEditUserRating.rating.title"></message></label>
        <div class="form-control-group">

            <div>
                <input type="radio" ng-value="null" name="{{userRatingPickerInputName}}" ng-model="workingUserRating.rating">
                <span class="muted"><em><message key="rating.none"></message></em></span>
            </div>
            <div ng-repeat="possibleValue in userRatingPickerPossibleValues">
                <input type="radio" ng-value="possibleValue" name="{{userRatingPickerInputName}}" ng-model="workingUserRating.rating">
                <rating-indicator rating="possibleValue"></rating-indicator>
            </div>

        </div>

        <div class="form-action-container">
            <button
                    ng-disabled="addEditRatingForm.$invalid"
                    ng-click="goSave()"
                    type="submit"
                    class="main-action">
                <span ng-show="workingUserRating.code"><message key="addEditUserRating.saveChangesAction.title"></message></span>
                <span ng-show="!workingUserRating.code"><message key="addEditUserRating.addAction.title"></message></span>
            </button>
        </div>

    </form>
</div>

<div class="footer"></div>
<spinner spin="shouldSpin()"></spinner>

